//页面的onload事件
function loadNews(){
	findMsgByID(this.opener.newsID);
}

//根据newsID查到对应的新闻记录
function findMsgByID(newsID){
	if(bXmlHttpSupport) {
    	var sUrl = 'findMsgByID.action';
    	var params = "msgID=" + newsID;
        var request = new XMLHttpRequest();
        request.onreadystatechange = function() {
        	if(request.readyState == 4) {
            	var oRequest = eval('(' + request.responseText + ')');
            	//alert(request.responseText);
            	var msg = oRequest.custMsg;
            	putMsgIntoPage(msg);
			}
    	};
    	request.open('POST', sUrl);
    	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
    	request.send(params);
    }
}

function putMsgIntoPage(msg){
	var msgTitle = document.getElementById("msgTitle");
	msgTitle.value = msg.title;
	var msgContent = document.getElementById("msgContent");
	msgContent.value = msg.content;
	var msgName = document.getElementById("msgName");
	msgName.value = msg.name;
	var msgMobile = document.getElementById("msgMobile");
	msgMobile.value = msg.mobile;
}